Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow performance when first loading a repository #400

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Slow performance when first loading a repository #400

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 11, 2014

My repository has about 20k commits, but a lot of tags and branches. 1964 takes over 10 seconds to load it (on a Mac Pro), this change brings it back to about 1s, on par with 1899 (I think it's still slightly slower, but it doesn't bother me enough to measure it more accurately).

This was introduced in 65a0c10.

There is no need to check if items are in a set before adding them, because NSMutableSet already makes sure the added objectes are unique (see -[NSMutableSet addObject:] docs).

NSMutableSet makes sure the added objectes are unique.
@ghost ghost changed the title A recent change caused a performance problem when first loading my repository Slow performance when first loading a repository Nov 11, 2014
@bquorning
Copy link

There is no need to check if items are in a set before adding them, because NSMutableSet already makes sure the added objectes are unique (see -[NSMutableSet addObject:] docs).

Isn’t that the entire reason for using a Set instead of an Array in the first place?

👍

@ghost ghost mentioned this pull request Nov 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants